import request from "@/utils/request";

export const post = (url, params) => {
  return new Promise((resolve, reject) => {
    request.post(url, params).then(res => {
      if (res.code === 'S') {
        resolve(res);
      }
    })
    .catch(err => {  })
  })
}

export const postObj = (url, params, isAsc = 'desc') => {
  return new Promise((resolve, reject) => {
    request.post(url, {
      param: params,
      orderBy: {
        isAsc
      },
      current: params.current,
      limit: params.limit
    }).then(res => {
      if(res.code === 'S') {
        resolve(res);
      }
    })
    .catch(err => {  })
  })
}

